package com.homegoods.classify;

import com.homegoods.area.model.SubModelList;
import com.homegoods.classify.model.ClassifyBean;
import com.homegoods.classify.model.ClassifyModel;
import com.homegoods.classify.model.Constant;
import com.network.retrofit_rx.Api.ActionSubscriber;
import com.network.retrofit_rx.Api.CommandImpl;
import com.network.retrofit_rx.Api.HttpManager;

import org.json.JSONObject;


import io.reactivex.functions.Consumer;

public class ClassifyApiUtils {
    /**
     * 获取品牌分类
     * /AMAPI/DListCenter.aspx?AppType=factory_
     *
     */
    public static void getBrandList(Consumer<SubModelList> consumer, Consumer<Throwable> error) {
        CommandImpl command = new CommandImpl.Builder()
                .setUrl(Constant.SERVER_URL + Constant.DLIST_CENTER)
                .addParams("AppType", "factory_")
                .setObject(true)
                .setClass(SubModelList.class)
                .create();
        HttpManager.getInstance().get(command, new ActionSubscriber<>(consumer, error, null));
    }

    /**
     * 获取所有分类信息
     * @param consumer
     * @param error
     */
    public static void getZPClassifyList(Consumer<ClassifyModel> consumer, Consumer<Throwable> error) {
        CommandImpl command = new CommandImpl.Builder()
                .setUrl(Constant.SERVER_URL + Constant.BRAND_LIST)
                .setObject(true)
                .setClass(ClassifyModel.class)
                .create();
        HttpManager.getInstance().get(command, new ActionSubscriber<>(consumer, error, null));
    }


}

























































































































































































































































































































































































